Skip to content

fix: Log invalid context kinds at error level - #49

Open
kinyoklion wants to merge 2 commits into
mainfrom
devin/1794846350-ruby-invalid-kind-diagnostic
Open

kinyoklion wants to merge 2 commits into
mainfrom
devin/1794846350-ruby-invalid-kind-diagnostic

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

Accepted OFP requirement 2.1.4.1.

Describe the solution you've provided

Log an error, rather than a warning, when ignoring a non-string context kind. The existing user-kind fallback is unchanged. Extend the existing invalid-kind test to check the diagnostic.

Describe alternatives you've considered

Keeping a warning hides this required OFP diagnostic from applications with an ERROR log level.

Additional context

The original converter and invalid-kind test were written by Matthew M. Keeler; this fix is by Devin for Ryan. Updated cleanly with main after #45 merged (8ae500c). Local Ruby 3.4: 78 examples pass; RuboCop clean. CI passes on Linux Ruby 3.4, JRuby 10.0 and Windows Ruby 3.4; Devin Review found no issues. Left as a draft per Ryan's account setting.


OpenFeature Maintainer opened this PR for Ryan
Implemented in session Audit openfeature-ruby-server provider this week
Review with Devin · Open in Devin Desktop


SDK-3721


Note

Overview
When an OpenFeature EvaluationContext supplies a non-string kind, the converter still discards it and defaults to user, but the diagnostic is now emitted at error instead of warn so it meets OpenFeature provider requirement 2.1.4.1 and shows up for apps that only surface ERROR-level logs.

The existing invalid-kind spec is extended to assert the logger output includes ERROR and the same message text.

Reviewed by Cursor Bugbot for commit f347acf. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@kinyoklion
kinyoklion marked this pull request as ready for review November 16, 2026 22:20
@kinyoklion
kinyoklion requested a review from a team as a code owner November 16, 2026 22:20
@cursor cursor Bot added the risk:low label Nov 16, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low.

Automated risk review (dry run): Low

This PR would be automatically approved.

Why: This is a one-line log-level change in lib/ldclient-openfeature/impl/context_converter.rb (warn to error for non-string kinds) plus a matching assertion in spec/impl/context_converter_spec.rb.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant